import 'article_data_bean.dart';

class HomeArticleListEntity {
  HomeArticleListData? data;
  int? errorCode;
  String? errorMsg;

  HomeArticleListEntity({this.data, this.errorCode, this.errorMsg});

  HomeArticleListEntity.fromJson(Map<String, dynamic> json) {
    if (json["data"] != null && json["data"] is Map)
      this.data = HomeArticleListData.fromJson(json["data"]);
    if (json["errorCode"] is int) this.errorCode = json["errorCode"];
    if (json["errorMsg"] is String) this.errorMsg = json["errorMsg"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data["data"] = this.data?.toJson();
    data["errorCode"] = this.errorCode;
    data["errorMsg"] = this.errorMsg;
    return data;
  }
}

class HomeArticleListData {
  int? curPage;
  List<ArticleDataBean>? datas;
  int? offset;
  bool? over;
  int? pageCount;
  int? size;
  int? total;

  HomeArticleListData(
      {this.curPage,
      this.datas,
      this.offset,
      this.over,
      this.pageCount,
      this.size,
      this.total});

  HomeArticleListData.fromJson(Map<String, dynamic> json) {
    if (json["curPage"] is int) this.curPage = json["curPage"];
    if (json["datas"] is List)
      this.datas = json["datas"] == null
          ? null
          : (json["datas"] as List)
              .map((e) => ArticleDataBean.fromJson(e))
              .toList();
    if (json["offset"] is int) this.offset = json["offset"];
    if (json["over"] is bool) this.over = json["over"];
    if (json["pageCount"] is int) this.pageCount = json["pageCount"];
    if (json["size"] is int) this.size = json["size"];
    if (json["total"] is int) this.total = json["total"];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data["curPage"] = this.curPage;
    if (this.datas != null)
      data["datas"] = this.datas?.map((e) => e.toJson()).toList();
    data["offset"] = this.offset;
    data["over"] = this.over;
    data["pageCount"] = this.pageCount;
    data["size"] = this.size;
    data["total"] = this.total;
    return data;
  }
}
